Some notes for optimizing IF statements