fixup unused codes and clean up cabal