Optims & code cleaning