Refactor HTML method; EM request for pages loading properly