Add const keyword, use references, coding style

* Methods which doesn't change an attribute should be set as `const`.
* Pass arguments as reference to avoid copy.
* Line length: 80.