Some utility functions which make life easier.