Moved survey layout builder into its own function.