Fix mixed declarations and code
We use -Wdeclaration-after-statement for a reason. My perosnal opionion is that this leads to cleaner code.