refactoring + layout