Mechanism of action of allopurinol is