I'd like to see this as a readably chunk using methods to work out the conditional parts. I had trouble parsing this.