clean logic structure