SIMPLIFY ALL THE THINGS!

- use anonymous function for scoping
- make things more readable