Reduced boilerplate code in login