Moved login/logout logic to a separate UserService