Refactor form input