refactored to use a genric resource mixin