some small changes and improvements. validates with fewer errors