Minor refactoring applied