Refactor handlers into own file, factor out display logic in generate and validate handlers