Simplified code

* Changed `do`-`end` statements that span over one line to `{}s`
* Changed `:to => url` to `to: url`
* Changed consecutive one-line comments to multiline comments
* Reformatted commented out code