Extrat find command statements to get_cmd_index()
Fix wrong comparison while parsing command
Unify command structure initialization