Added small util method to preferences