The identation of all the ifs is really ugly