Major refactoring. General layout change