Refactor collectionName->resource