lots of cleanup; trimmed namespace