refactoring exceptions caught in the main
Further testing of configurations where there are some substitutable elements