object-oriented and extensible re-implementation