nit: you could write `match (direction, is_groove)` here.