Revert "Merge pull request #2453 from tenderlove/refactor"

This reverts commit afc5660e0cc6fba638d93ffac70b986ba1894fb6, reversing
changes made to e97ace7214f3fa42a20294081c86d28a3f614a4d.