GPIO improvement: templating almost finished