More work on profile handlers, still have some more refactoring to do