refactor method edit in users controller