Plugin: Minor formatting and refactoring of function calls

Avoid unnecessary temporary variables and methods (_open_file_workaround)