layout refactor