some code cleanup applied