Reorganize and clean libraries