add warning compilation options and clean code