Modify from function to object