Refactor to use DSL functions.