you mentioned doing this in a more idiomatic impactjs way, so feel free to change this