Refactored prepare resource framework
Merge pull request #343 from shenrie/master

Refactored prepare resource framework