clean version function