Refactoring; open-run-close calls, remote calls