draft new codex structure and mime calculation