started to move login and register logic to logic layer