refactor restart app to use a dictionary for different instances

fixes #11