Refactor users code