Simplify _get_action function

Use dictionary to remove trails of if else