refactor user verification