Refactoring of Code. Added FileHandler.java class