[TASK] Skip a few class instantiations on early returns
[TASK] Remove and unset unused variables and functions
[TASK] Remove redundant closing tags
[DOC] Add missing PHPDoc blocks