Implementation exit function