restructuring for lib and repo