more restructuring with libraries