Refactor layouts and styles