Given all the multiple if statements, I think I'd prefer to have one single big if/else statement at the top of the module - if windows here are some constants for break/kill, otherwise use these.