Refactor of layout