make code comply with various rules