Refactored code to remove bluk of the content from __init__.py