Implemented class construction in library insertions, optimized class instance construction slightly