refactor and add todos