Grinder: Optimizing the cost structure