Please put in a fast exit instead of everything inside a long if block.