Refactor deck saving to doctrine