Converted procedural code to initial object oriented setup.