Refactor modelTo

Refactored lookup code into `lookupModelTo`; make sure params.as is not overwritten.