mapCommand and commandFactory and use string key in event listener