Optimized Refinement for Spatially Adaptive SPH