Refactor html editor