V3:refactor to use oop