Refactor user handling