refactor LayoutView into its own file