abstracting fs write