factored out common services
fixed resource bug