Update and code cleaning