Refactor code to be more Ruby/Rails-like, and put Objective-C handlers out in helpers