Code review changes to loginHandler