Profile changes and refactoring 

Please explain whats happening here.