Updated to be less reliant on html structure