[reference] cleaned up and fixed reference forms generator