converted pieces to use abstract OOP