Removes duplicated code