WIP - reorg code, try to render fragments in editor