Refactoring the crud, so can have CLI opts