Remove unnecessary end tags to avoid headaches with white space