move profile handler into its own thing