refactored modelService