Refactor out some old code