refactor setup