refactor transient_for implementation