initial prototype implemetation for issue #565