Added confirmation dialog on exit. Refactor of card activity class