Refactored by extracting methods and updated user_registration file