GPIO refactoring