a bit of refactoring
started writing tests for checking sample file