In addition to moving the code to a separate class, this also improves flushing behaviour by limiting the amount of memory being initialized rather than the number of commands executed.