Improvements

- code restructuring part 3