Unify note and terrain search

Leetle bit of refactoring too.