completed GPIO refactoring and synchronisation