[misc] Small refactoring