Move util functions to utils.go file