Added model count function and refactored into tests