[main] Minor refactoring