De-duplication and refactoring as I add STM32F3 bits