Another code reorganization plus migrations