The Bus and Pin classes rewritten as templates