Yang: 1. refactor some code; 2. add 3 new method to deal with in-file
operate