refactoring, and going over inline TODO items.