code cleanup in preparation for new version