small refactoring and indents