Refactoring slave flashing code into its own class.