refactored layout component