refactoring of profiles creation