Simplify pyramid construction query