Initial implementation for #2.