Refactored ActiveQuery::createModels() to avoid duplicated models