refactoring of profile api in the frame of the pull request #1