Optimize the lib

Optimize the lib for integration more simple.