simplyfy conditional structure