Partial implementation of #12