Simplify entire code