CODE CLEANING:
msg selected by Kind and not by name
switch instead of if else if else structure