the code to make an Activity Configuration should be put into a method to avoid duplication with the same code below.