Update code according to TODO notes