use synchronous file writing to avoid bugs
factor out view-path