some utilites functions