Refactor context to not use vars