Code cleanup
- Organized imports (removed unused ones)
- Moved static helper to place of usage
- Renamed variables and types for better meaning