add simple verify test, some refactoring