Made it more object oriented