refactor/organize code and add todo