Major Refactoring and cabal