Use generics in form elements