Suggested changes

I don't use Rails, but I simplified some of the code anyway