Rewriting some code for the default apiary layout.