Refactor, in particular removing class vars