Refactored Factory for the records to one class, fixed some bugs, added new tests to the main method, added comments to the solution.