Refactor and add convenience mapRuntime() function.