Removed duplicated code