refactor: less identation ifs