Code formating. Minor refactoring