replace recursively including method