common util methods for Go