CLI repack support + refactoring.