modularise each task

organise tasks in external file for better code maintainability