structuring JS file for todo list