restructured; refactored; metadata fmt change; token check