got registration test passing and refactored