Refactored registration