refactored base setup method