Replaced HTML insertion by DOM building