Unnecessary second if removed