css styling the 3rd, plus some refactoring