There is no secret recipe, enclosing central territory is tough. Sometimes you can achieve it if you keep some bargaining power. But in your case, you gave black solid corners, and on the contrary it was a white group that was under attack.