refactor out old code