small fixes and reorganization