Some refactoring in progress.