Removed duplicated code

Removed duplicated code