took a more OO approach