Refactor the whole forms generator.