Cleanup whitespace and switch statements