Review and improve code