Refactor HDL generation.