Optimizing Improved Hardy Inequalities