Minor refactoring
Some refactoring