Additional tests and fs mock
Refactor required to be able to test the code. Added two tests