refactored registration controller