refactored validation on registration
refactored registration validation