Changes to make more flexible