Updated todo list: fixed small bugs and code refactoring