cleaned up duplicate resource loading code