Refactored functional tests.