Fix Duplicated code