General formatting and code cleanup
No major functionality changes