Moved code into Utils.hs