Cleanup whitespace
Cleanup whitespace + move functions for easier reading.