Removed duplication and added a few TODO items.