Remove non working when-then