Plot refactor