refactored setup