Moved setup logic