Minor refactoring before merging