Refactored bracket rendering code.
Refactoring.