Removed legacy code
Improved formatting
Fixed repository mapping logic.