Refactoring, gate cost save optimisation.