Change variable definitions and scope