Refactor CEDocument more