Maybe extract this mechanism for executing commands into a standalone method.
```Java
public static Integer execCommandsAtLocation(Location loc, String... cmds) { /* TODO */ }
public static Integer execCommandsAtLocation(Location loc, Iterable<String> cmds) { /* TODO */ }
```