Normalize code style and simplify expressions