refactoring resource descriptor

@fosdev Please review and merge.