Refactored initialization