Duplicated code eliminated