Change function to object, to meet plugin factory requirements