integrated create statement. improved error handling to throw exceptions