Move logic to global page