cleaning code using @intinig suggestions