Added some util code