refactor, clean up, and comment sibling, adjacent, and nthChild