added the history to utility, cleaned up the stuff from the global scope