Refactor: map canvas and script