Refactor raptor.hs, update test case.