code clean up; add todos for improving script