Handling colors changing and code cleaning