Refacotring exit point. Inline -> call gen_exit