refactor adding and removing vars from plots