Improvements

- code restructuring part 4