code cleanup and rename