Use when instead of then