refactering layout component