[#692] Code clean up

* Removes unused imports, variables
* Formats some `if` expressions