refactor to generic setup