Some refactors.
Merge pull request #7 from pasku/master

Some refactors I noticed when reading through the code.