refactor to use real a more OO approach