Fix a few more whitespace issues
Code refactor mkI

Too many changes to list separately, no difference in functionality, just moving stuff around,
hopefully making code an easier read.