refact code path