updated script based impl