refactor usermanagement