Remove global code, and put it inside the construct