code cleanup before first tag