Decoupled root check from main file.