Refactored to allow other layouts to be added.