Restructuring for lib