optimizing quit action

i have just took a look on the quit action, i think this would be much easier.