refactored file utilities into seperate class