some documentation and reorganization