Some refactor and add the spec for bacula_director_catalog_spec.rb