Refactor use of Cabal