reorganize into library structure