refactor: simplify code path