improved resource loading