Refactored functional tests into separate files