cleanup to prev: improved scoping, removed consoles, little styling