moved common code to ags commons