Passing functional tests after refactoring