Major overhaul and refactoring of hand generation.