Reorganizes libraries and imports