Moved bracket code to a class