Optimization of evaporative cooling in trapped bosonic atoms