Refacotr test code using open class