add age condition and made some cleanup