All the added code here should be moved to a separate object in a separate file.