move small functions to utils.d