Code optimize