Use File instead of String #1544
Refactor to make code more simple