Split up and using cabal
Added utility function `p`