Searching logic moved to model