Refactor code that copies flash in SetTheFlashMatcher