refactor to smaller modules and getting ready to make it a satandalone module