[refactor] use OO programming style