Simplify logic for reading html

Signed-off-by: Igor Popov <igor.popov89@gmail.com>
Extract method for extracting html

Signed-off-by: Igor Popov <igor.popov89@gmail.com>
Inline and rename variables

Signed-off-by: Igor Popov <igor.popov89@gmail.com>
Pass dependency as parameter

Signed-off-by: Igor Popov <igor.popov89@gmail.com>