first interactive app changes to create a common function