Refactor __init__