Refactor timeline recording and upload