some small refactorings to make the code more readable