init refactor for parse_resource