ui: fix var scope (refs #56)
Unused code removal (refs #38)