Refactored functional test into a common module for reuse