Refactor

ongoing pr....
just a reminder to change this once integration is merged