Performance enhancement, eliminate IllegealArgumentExcpetions