Code cleanup and comments - no functional changes