refactored and moved fileHandler to util package