optimize back reference