Use common implementation of search methods from fleximodel package.
Refactor to only access 'fields' attribute of a spec/type object through provided getters/setters/query methods.
Refactoring to clean up code.