Refactored object to prop and added comments