compressed the compileResources function