Fix codestyle of the current codebase

Actually it can be broken. I don't see specs and can't check it by hands, so I leave it for you. 
Also you can make code review if you have any questions.
Do not write to stdout. Use Rails' logger if you want to log.