Cleaned up quit method