Changes to make more functional