couple of util functions