functional test refactor