refactor user auth and edit capabilities