optimize: write only 3 times per file
optimize: write only 3 times per file

this makes the code more readable and reduces the number of syscalls
to write files

sampsyo/beets,beetbox/beets,jackwilsdon/beets,sampsyo/beets,sampsyo/beets,ibmibmibm/beets,shamangeorge/beets,beetbox/beets,beetbox/beets,ibmibmibm/beets,jackwilsdon/beets,beetbox/beets,SusannaMaria/beets,shamangeorge/beets,jackwilsdon/beets,sampsyo/beets,ibmibmibm/beets,ibmibmibm/beets,shamangeorge/beets,SusannaMaria/beets,shamangeorge/beets,SusannaMaria/beets,SusannaMaria/beets,jackwilsdon/beets