PLANNER-199: code style + name rules
PLANNER-199: refactor to remove unneeded joins and unneeded accumulate