Follow rails conventions

I'll comment line by line on Github to explain.