Heavy refactor/Bug Fixing/Improve semantic