TODO notes + minor code cleaning