moved loadResource to common