Codesniffer changes and refactoring of getModel to remove duplicate code.