Remove unnecessary declarations if statement