less ugly code dispatch