refactored functional tests