refactor: pass in open, pass in argv as options