Refactored to create minimal core api