general reorganization (ugly changes)