improve recompile/inject res code