Further improved and parameterized subprocess call.