put html parsing into seperate functions