Optimization of hierarchical structure and nanoscale-enabled plasmonic refraction for window electrodes in photovoltaics