small auth and login refactor