Refactor, cleanup, add tests
Refactor getMatchingObs(), add tests