added resource and factory functionality