Refactored account registration