Why did you wrap condition in function?