refactor some sidebar communication