Remove code duplication in DSL implementation.