Broke functions in to sub modules for easier management