Create and use common util function