General code cleanup for readability