Moved bracket generation to a fragment