refine the way we deal with form and replace it with ajax