Cleanup whitespace and code formatting for consistency