Small flash refactoring