Smarter ifblocks