Refactoring dynamic expresso and unit test