Small refactoring to allow for multiple filewriters