improve lib class