Formatted some code, cut down single ifs