removed private so that methods can be individually tested