removed duplicated code in statements