improve map function
improve map function