Slight changes to indentation and refactoring

nothing major