Refactor: define search functions at the bottom

of the model.
use hash_rockets instead of ruby19 hash syntax