refactor curly brackets