library optimization