simplify some codes in capturing phase