Various code cleaning