Part of the improvement in #107
Part of the improvement in #107