adding some OOP into the process, still WIP.