Restructuring and optimizing the lib file.