refactoring so that we can pass in array of libs