terminal pattern cleanup