Refactored model API.