some code clean up in user manager