some code cleanup