Refactor to move the farm into its own class instead of globals