Every time you repeat yourself, ask the question "is there a way to simplify?".  The first thing is thinking about your data filtering.  In this case every use of `data` beyond this point has the `reasonable` filter, so just do `data = data[reasonable]` right away and be done with it.