cleanup code

please check the TODOs