refactoring Functional tests