Refactoring more functional tests