Update to be more flexible