refactor base setup