refactored reg check
refactored login auth to model