Remove unnecessary code
Reorder life cycle methods