helper functions for Go