[ref] Big refactoring part2 (WIP)