dispViewDef is always a promise, maybe a displayViewPromise would be a better name, plus it should use then() not when().