Cleaned up form code