[misc] Minor refactoring