Move logic to runtime