Made classes more modular and object oriented.