Utility code for DR