Improve resource loading and more clean up