Moved mini-map logic in to plugin code