duplicated code removed