refactor file io counter project