Refactor
Add GHCi test; refactor