moved utility functions into utils.go