There's no need to do all these if...else check. Just pass the owner type as another parameter.