refactoring using prop method to update existing UI elements