Fix profile selection
Refactoring!