Moved the HAR processing into a library so it can be shared