new lib with some optimisation