Layout changes and code refactoring.
Remove redundant code.