functional_tests refactoring for code reuse
Merge remote-tracking branch 'origin/master'