Root check and optimations