Made it more objectoriented