Improved formTypes detection