some code cleanup of the recent changes