Improving run time library and clean up