initial impl of #657