#JC-1361 Refactoring of user registration logic