refactor descriptor parser