refactored to move the object managing to a seperate file
refactored to move the object managing to a seperate file