Duplicated code removed