Added some util functions