Refactor modules/vocabulary_spec to use vocabulary factory