Refactor to move code from _init_.py to modules