Improved p- and n-type thin-film microstructures for thermoelectricity