simplified code, support more options, like html