Preparing for code reorganization
Various modifications