Please refactor these setup steps so that it's instantly readable. Use helper functions (ideally centrally defined) if necessary.