Revert "simplified code"
Revert "simplified code"

This reverts commit 20e3af4ab446db3e56d0ff46e01cdfbba9a9f1dc.

FreemapSlovakia/freemap-v3-react,FreemapSlovakia/freemap-v3-react,FreemapSlovakia/freemap-v3-react