Improve modal performance & refactor var names. Bug 902697.