cleaned up tasks
- added correct err handling
- moved utility funcs under each task
- added logging
misc. issues