refactor Resource::validate()