remove extra bracket and spaces