Removing duplicate function