refactor out a few methods