Refactored errors on login