Refactor package factory for search model