refactor code to use resource loader

refactor code to use resource loader
images from docs