Minor refactoring and Todo removal