code cleanup - undefined variables