core: improve chained conditions processing