Using ```$pagePartClass``` instead of ```$type``` would make it a bit clearer what this var is used for.