Further factored out Python parts which need to change...