refactor to uses either `resource` or `resources`