Better library handling