Move widget creation code into the if statement instead of using the return pattern.