refactored functional test in ch5