refactor cgi editor