Merging duplicated code.