Fix #12723 and simplification and optmization of defaultDisplay helper