using when for faster clearcut response