created history.go file and moved corresponding functions there