changed to object oriented design