Adding a stronger modular structure while implementing tests to check various class functions