Added some DRY code
Moved to use the code in __init__