User registration improvements, refactoring