add replace method with method object