refactoring piston