modular for init, detect and recognize