Better automation of card code generation
Use generator functions to prevent attempt to load all entities into memory during a large database query