beginning code cleanup