Some refactoring with Michael

Correct indentations, rearrange code blocks