Standardize function names and clean up comments