Minor refactoring/improvement