optimize the input form