cleanup code slightly.