Remove redundant if check and fix styling on if statements