Replace code checking function safety to use ast tree checker.