Added Testcase and TestcaseFactory classes and refactored the main class so that it uses the new classes