Minor refactoring, commenting