define variables only once
cleanup whitespace : remove tab
replace ['display'] by .display
fix coding style, use !== to compare with null