useful, standalone utils written by Garrydzeng