fix popup outside map + small cleanup and refactoring
Merge pull request #118 from Wikia/MOB-1974

fix popup outside map + small cleanup and refactoring