move user related code to module

work in progress, related to #4734