Layout update implemented.
Some refactoring done.
Revert "Some refactoring done."

This reverts commit 1523003f06bdc7e8c0bbea8d7499dd3de8a2074b.