Refactor sonar plot