make the logic more clear