ok, i think refactoring is done
still need to fix the testing coverage.
but i think it's worth to merge it into main now