Too bad python doesn't have an "inline" concept :racehorse: 
I'll look at moving it into the main loop