Role of microhabitats and competition in coral reef community structure