add comments, update todos, refactoring