fix #15 and optimize map handling
fixed #19
resolve #13
resolve #6