I will rebase against #349 to use the general functionality