Improve coding style and clarify a few things