code duplication was avoided in LoginForm