Introducing factory methods to handle creation of beans in a nicer way.
Introduced parameterized test to avoid repetition and added Integration test to cover the scenarios described in the AC.