Fixed a bug where a card could be pushed to the same stack multiple times. Also, refactoring.