Indentation fixes and some more refactoring.