Seems like I've got your idea. You gonna to move all logic of HAR logging into separate method? if so, then I totally agree with you.