Move code out of __init__