Updated code duplication as discussed.