more cleanups and adding new library module