final code cleanup