[refactor] into object-oriented framework for testing