stashing code
refactored registration and errors