Minor refactorings to adhere to the DRY principle