fix setup called after draw bug
refactor setup handling