[misc] Code cleanup
- removing unused imports
- refactoring in order to get rid of some deprecated methods