moving map functions outside ko app