refactor main jsp