Done some small refactoring.