Added some useful util functions