Factor out common code from DE2-115