extract some generic user functions to user module