code cleanup renaming some functions