Implement replaceBody