factor out results method and fix a few tests