util functions that tj commonly uses