before make big change
split automation logic into some classes.