refactored resourcebuilders to re-use boilerplate code