optimize code completion