some utils, misc codes