Clean lua code ; add todo notes