refactor verify