[minor] Extracted the resource loader and moved it to it's own module.