Ported core code to modern D