get_stats should return a hash, so `Hash[stats]` inside of it.  That should also eliminate the need for this `if`/`else`.