Factor out user tests and before hook