Pass hash ref to runCommand function instead of multiple variables