refactor map create action and move logic into map model