add final test mock up
some refactoring