Refactor and todo comments