Refactored deck module for error codes