refactor coding using vaint