log rotation; test internet; misc small fixes
minor refactoring