Small refactoring and added some TODOs.