Refactor handle_proiles(...).

Create list_profiles_exit(...).
Change variable names for consistency.