Move logic out of init.js to dispatch function in users.js