separated library path for different version #48, and refactor common used method.