inlining migrate summary logic to `Direction`, replacing `case` statement for before/after text with polymorphism