refined login and register classes