refactored card validation logic into django form