Applied some small refactorings.