Some refactoring
Simple search, some more refactoring...