Initial implementation of #626