Added factory for Maps
Fixed some bugs