minor code cleanup and todo insertions