Collapse primary_user modules

Reduces duplicate code.
See Issue #3184