General code and OO principle improvements.