dev/core#1344 Re-work if statements and remove excess ifs