Remove unnecessary if blocks
Add back some if blocks around bigger chunks
Fix @file standards and indentation