A messy rails app refactored.