layout refactoring almost done