Modularize base library