Add Replace method with Method Object refactoring