Code refineing