Code cleanup, TODO additions