moved variables inside