Removed unnecessary ifs.