Moved some misplaced variable definitions