Extract variable lookup into a function
Simplify some shit
Run autoformat