Add support for Libs, optimize dependencies