Refactor to share code and make it easier to add wedge exp