Map: Refactored Map functions

* Separated the map script into another file.
* added a temporary file as a guide. this should be removed later.