Refactor Calculate Cell Height method.