move common cleanup steps to common