More work on setup refactoring