Fix old shadowing variable.
Refactor classes and argument passing.