Fix menu jumping mentioned in #122
Therapeutic refactoring, make interwebs angry

var keyword on each line, make interwebs angry

Therapeutic refactoring