Add more types of flatten methods to DSL