Fixed map canvas
Code refactoring