Cleaned TODOs and minor refactor.