There are a lot of changes here that are shared with your profile generation work. Let's land pr #11, have you rebase the new work in, and then look at this once more.