Made centering by minimap
Minor refactoring