Code refactoring and layout/styling improvements.