refactoring layout styles and rules