cleanup/refactoring, testing card generation